﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="hotelinformation.aspx.vb" Inherits="hotels.hotelinformation" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">



    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="HotelName" HeaderText="HotelName" 
                SortExpression="HotelName" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:ImageField DataImageUrlField="Picture">
            </asp:ImageField>
        </Columns>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hotelsConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:hotelsConnectionString.ProviderName %>" 
        SelectCommand="SELECT [HotelName], [Description], [Picture] FROM [hotellist] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <br />

    <br />

    <div style ="overflow:auto>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="CommentsDataSource" Width="432px">
        <Columns>
            <asp:TemplateField HeaderText="Comments">
            
            <ItemTemplate>
            <div style="background-color:Silver">           
            <b><span style = "background-color:Yellow">
            <%# Eval("Author")%></b></span><br />
            <%# Eval("Subject")%><br />
            <%# Eval("Message") %><br /></div>
            </ItemTemplate>

            <AlternatingItemTemplate>
            <div style="background-color:White">           
            <b><span style = "background-color:Yellow">
            <%# Eval("Author")%></b></span><br />
            <%# Eval("Subject")%><br />
            <%# Eval("Message") %><br /></div>
            </AlternatingItemTemplate>

            
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    </div>
    <asp:SqlDataSource ID="CommentsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hotelsConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:hotelsConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Subject], [Message], [Author] FROM [Comments] WHERE ([HotelID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="HotelID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    Add your comment:<br />
    <br />
    Name<br/>

    <asp:TextBox ID="tb_Author" runat="server" Width="565px"></asp:TextBox>
    <br />
    <br />
    Title<br />
    <asp:TextBox ID="tb_Subject" runat="server" Width="556px"></asp:TextBox>
    <br />
    <br />
    Comment<br />
    <asp:TextBox ID="tb_Message" runat="server" Height="163px" Width="560px" 
        TextMode="MultiLine"></asp:TextBox>
    <br />
    <br />
    <br />
    <asp:Button ID="btn_Comment" runat="server" Text="Comment" />

</asp:Content>
